$(document).ready(function(){

    var dan = $('#datos').data('datos') || {};
    $('input[name="nombre"]').focus();

    if(dan.a){
        $('#aviso').modal('show');
    }

    $(".telefono").intlTelInput({
            allowExtensions: true,
//            autoFormat: false,
            autoHideDialCode: false,
            //autoPlaceholder: false,
            defaultCountry: "mx",
            // geoIpLookup: function(callback) {
            //   $.get('http://ipinfo.io', function() {}, "jsonp").always(function(resp) {
            //     var countryCode = (resp && resp.country) ? resp.country : "";
            //     callback(countryCode);
            //   });
            // },
            nationalMode: false,
            //numberType: "MOBILE",
//            onlyCountries: ['us', 'gb', 'mx'],
            preferredCountries: ['mx', 'us']
    });
});
